package com.demo.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 数据字典表非固定值的可后期增变的及全局信息如医院名称、医院logo等
 * @author zm
 * @since 2020-11-24
 */
@Data
@TableName("pd_dictionary")
@ApiModel(value="Dictionary对象", description="数据字典表非固定值的可后期增变的及全局信息如医院名称、医院logo等")
public class Dictionary implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "字典编码")
    @TableId(value = "dictionary_code", type = IdType.AUTO)
    private Integer dictionaryCode;

    @ApiModelProperty(value = "字典名称")
    @TableField("enumeration_name")
    @NotBlank(message = "字典名称不能为空")
    private String enumerationName;

    @ApiModelProperty(value = "字典值")
    @TableField("enumeration_value")
    @NotBlank(message = "字典值不能为空")
    private String enumerationValue;

    @ApiModelProperty(value = "字典值类型 0字符 1数字")
    @TableField("enumeration_type")
    @NotNull(message = "字典值类型不能为空")
    private Integer enumerationType;

    @ApiModelProperty(value = "排序")
    @TableField("sort")
    private Integer sort;

    @ApiModelProperty(value = "上级字典编码")
    @TableField("parent_dictionary_code")
    private Integer parentDictionaryCode;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID号")
    @TableField("created_user_id")
    @NotNull(message = "创建人ID不能为空")

    private Integer createdUserId;

    @ApiModelProperty(value = "删除时间")
    @TableField("deleted_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deletedTime;

    @ApiModelProperty(value = "删除人ID号")
    @TableField("deleted_user_id")
    private Integer deletedUserId;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time",fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    @ApiModelProperty(value = "更新人ID号")
    @TableField("updated_user_id")
    private Integer updatedUserId;


}
